function [x,y] = getfirstdaydata(datastruct,pt,v,LIMS)
%GETFIRSTDAYDATA	get first 24 hours of the patient record for the specific variable
%	[x,y] = getfirstdaydata(datastruct,pt,v)
%	
%
%	Inputs:         datastruct      data structure
%                   pt              patient index
%                   v               variable       
%                   LIMS            lower and upper limits of the variable
%
%	Outputs:        x,y             time and correspondent data
%		
%		
%	
%	See also Gui_icu24gp

%	References: N/A
%	
%	

%	Copyright 2013 MAF Pimentel
%	This program is free software: you can redistribute it and/or modify
%	it under the terms of the GNU General Public License as published by
%	the Free Software Foundation, either version 3 of the License, or
%	(at your option) any later version.
%	
%	This program is distributed in the hope that it will be useful,
%	but WITHOUT ANY WARRANTY; without even the implied warranty of
%	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%	GNU General Public License for more details.
%	
%	You should have received a copy of the GNU General Public License
%	along with this program.  If not, see <http://www.gnu.org/licenses/>.


%	$Author: MAF Pimentel$
%	$Revision: 1.0.0.0$
%	$Date: 12-Jun-2013 15:22:40$
%	Contact: marco.and.pimentel@gmail.com
%	Originally written on: PCWIN64

x = datastruct{pt}.data{v}(datastruct{pt}.data{v}(:,1) <= 24*60,1);
y = datastruct{pt}.data{v}(datastruct{pt}.data{v}(:,1) <= 24*60,2);
x(y < LIMS(1) & y > LIMS(2)) = [];
y(y < LIMS(1) & y > LIMS(2)) = [];
x = x/(24*60);

end